Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'strict' mode #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuukkamustonen
Copy link

@tuukkamustonen tuukkamustonen commented Oct 25, 2019

Sketched something for #39.

  • Using loader as vessel to deliver options. Not perfect, but should work.
  • Should probably be called something else than "strict" mode, to distinguish from Velocity's strict mode. Maybe stricter mode :P ?
  • Needs way more tests, I would say

What do you think? Do you see fundamental problems here?

This raises TemplateExecutionException if reference does not exist in content.
It's even stricter than Velocity's "strict mode", that accepts undefined
variables (in special cases) in #if blocks.
@purcell
Copy link
Owner

purcell commented Oct 25, 2019

Thanks! Thinking about this, I guess another way to do it might be to support a well-known object in the namespace, e.g. airspeed_options, or just an airspeed_strict var. Then a user can pass that in as part of the namespace handed to merge. This would be a simpler implementation, and I don't see any particular downside.

@tuukkamustonen
Copy link
Author

tuukkamustonen commented Oct 28, 2019

Yeah, that would work, too. It would kinda feel dirty to pollute user's namespace, but I guess there's no harm so why not. I can change it.

Any other changes you'd like to see here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants